<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_Ion_auth extends CI_Migration {

    public function up()
    {
        $users = array();
        
        $user_id = array();
        $user_id['type']            = 'INT';
        $user_id['constraint']      = 5;
        $user_id['unsigned']        = TRUE;
        $user_id['auto_increment']  = TRUE;
        
        $users['id'] = $user_id;
        
        // add fields
        $this->dbforge->add_field($users);
//        $this->dbforge->add_field("id int(11) unsigned NOT NULL AUTO_INCREMENT");
        $this->dbforge->add_field("email varchar(255) NOT NULL DEFAULT ''");
        
        // add keys
        $this->dbforge->add_key('id', TRUE);
        
        // create table
        $this->dbforge->create_table('users', TRUE);
    }

    public function down()
    {
        $this->dbforge->drop_table('users');
    }
}